package com.mes.controller.manu;

import com.mes.service.manu.CuttingJobsService;
import com.yy.base.common.action.BaseCtrl;
import com.yy.base.page.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("CuttingJobsr")
public class CuttingJobsrController extends BaseCtrl {
	@Autowired
	private CuttingJobsService cuttingjobsservice;

	//根据传过来的矢量图编码带出明细信息
	@ResponseBody
	@RequestMapping(value="getPhotoLists", method=RequestMethod.POST)
	public Message getPhotoLists(HttpServletRequest request) {
		Message msg = new Message();

		String code = request.getParameter("PhotoCode").toString();   //矢量图编码

		msg.setData("Photolist",cuttingjobsservice.getPhotoLists(code));

		return msg;
	}

	//根据工单号查询该工单下的部位裁断信息
	@ResponseBody
	@RequestMapping(value="getJobOrderLists", method=RequestMethod.POST)
	public Message getJobOrderLists(HttpServletRequest request) {
		Message msg = new Message();

		String code = request.getParameter("planCode");   //工单编码
		msg.setSplitPageList(cuttingjobsservice.getJobOrderList(code));
		return msg;
	}
}